package com.shuoyue.ycgk.ui.news;

import android.widget.ImageView;

import androidx.core.content.ContextCompat;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.shuoyue.ycgk.R;
import com.shuoyue.ycgk.appcatch.FileUtil;
import com.shuoyue.ycgk.base.baseadapter.AppBaseQuickAdapter;
import com.shuoyue.ycgk.entity.NoticeFile;

import java.io.File;
import java.util.ArrayList;
import java.util.List;

/**
 * 下载的课程适配器
 */
public class NoticeFileAdapter extends AppBaseQuickAdapter<NoticeFile> {


    public NoticeFileAdapter(List data) {
        super(R.layout.item_noticefile, data);
    }


    @Override
    protected void convert(BaseViewHolder helper, NoticeFile item) {
        helper.addOnClickListener(R.id.tv_title);
        File file = new File(FileUtil.getPath(mContext) + "/头条/", item.getAttachmentName());
        if (file.exists()) {
            helper.setText(R.id.tv_title, "(已下载)" + item.getAttachmentName());
        } else {
            helper.setText(R.id.tv_title, item.getAttachmentName());
        }
    }

}